package com.samphanie.auiu.common.dto;

import com.samphanie.auiu.common.constants.AuiuConstants;
import com.samphanie.auiu.common.validation.PasswordMatches;
import lombok.*;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author ZSY
 * @email 1451691457@qq.com
 */
@With
@Builder
@PasswordMatches
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RegisterDto implements Serializable {
    private static final long serialVersionUID = -1346986621606531943L;

    @NotNull
    @Size(min = 3, max = 50)
    private String username;

    @NotNull
    @Size(min = 1, max = 50)
    private String nickname;

    private String avatar;

    private String password;

    @NotNull
    @Size(min = 1)
    private String matchingPassword;

    @NotNull
    @Size(min = 1)
    private String email;

    @Pattern(regexp = AuiuConstants.PATTERN_MOBILE)
    @NotNull
    private String mobile;
}
